package com.briup.day11;

import com.briup.day11.interfaceBean.Animal;
import com.briup.day11.interfaceBean.ICycleAble;
import com.briup.day11.interfaceBean.IJumpAble;
import com.briup.day11.interfaceBean.Monkey;

public class Test_interfaceAbs {
    public static void main(String[] args) {
        Animal animal = new Monkey("金色",100,"悟空");
        animal.eat();
        animal.sleep();
        //        a.jump;a.cycle不行
        System.out.println("--------------------------");
        ICycleAble ic=new Monkey("黄色",10,"吗喽");
        ic.cycle();
        System.out.println("----------------------------");
        IJumpAble ij=new Monkey("金色",26,"hou");
        ij.jump();
        System.out.println("----------------------------");
        if(ic instanceof Monkey){
            Monkey monkey=(Monkey)ic;
            monkey.eat();
            monkey.sleep();
            monkey.cycle();
            monkey.jump();
        }
    }
}
